/**
 * Reducer 数据处理
 */
import {type} from './../action';

// 初始化状态
 const initialState = {
     menuName: '首页'
 }
 // reducer就是一个纯函数，接收旧的state和action，返回新的state
 export default (state = initialState, action) => {
    switch (action.type) {
        case type.SWITCH_MENU :
            return {
                ...state,
                menuName:action.menuName
            }

        break;
        default: 
            return {
                ...state
            };
        break;
    }
 }